/**
 * <b>项目名称：</b>网络应用框架<br/>
 * <b>包    名：</b>com.hhwy.framework.exception<br/>
 * <b>文 件 名：</b>ExceptionMessage.java<br/>
 * <b>版本信息：</b><br/>
 * <b>日    期：</b>2014年7月30日-下午8:23:24<br/>
 * <b>Copyright (c)</b> 2014恒华伟业科技股份有限公司-版权所有<br/>
 * 
 */
package com.hhwy.framework.exception;

import java.util.List;

import com.hhwy.framework.util.ExceptionFilter;

/**
 * <b>类 名 称：</b>ExceptionMessage<br/>
 * <b>类 描 述：</b><br/>
 * <b>创 建 人：</b>liuhai<br/>
 * <b>修 改 人：</b>liuhai<br/>
 * <b>修改时间：</b>2014年7月30日 下午8:23:24<br/>
 * <b>修改备注：</b><br/>
 * 
 * @version 1.0.0<br/>
 */
public class ExceptionMessage {

	/**
	 * 创建一个新的ExceptionMessage.java实例 ExceptionMessage.
	 *
	 * @param string
	 * @param e
	 */
	private String state = "error";
		private String type;
	private String exceptionMsg;
	private List<StackTraceElement> exceptionTrace;

	public ExceptionMessage() {

	}
	/**
	 * state
	 * @return  the state
	 * @since   1.0.0
	 */
	
	public String getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	
	public void setState(String state) {
		this.state = state;
	}


	public ExceptionMessage(Exception e){
		this.exceptionMsg = e.getMessage();
		this.exceptionTrace = ExceptionFilter.filter(e);
	}
	
	public ExceptionMessage(String type, Exception e){
		this.type = type;
		this.exceptionMsg = e.getMessage();
		this.exceptionTrace = ExceptionFilter.filter(e);
	}

	public ExceptionMessage(String type, String exceptionMsg, List<StackTraceElement> exceptionTrace) {
		this.type = type;
		this.exceptionMsg = exceptionMsg;
		this.exceptionTrace = exceptionTrace;
	}

	public String getType() {
		return type;
	}

	public ExceptionMessage setType(String type) {
		this.type = type;
		return this;
	}

	public String getExceptionMsg() {
		return exceptionMsg;
	}

	public ExceptionMessage setExceptionMsg(String exceptionMsg) {
		this.exceptionMsg = exceptionMsg;
		return this;
	}

	public List<StackTraceElement> getExceptionTrace() {
		return exceptionTrace;
	}

	public ExceptionMessage setExceptionTrace(List<StackTraceElement> exceptionTrace) {
		this.exceptionTrace = exceptionTrace;
		return this;
	}
}
